﻿using Engine.Objects.StaticObjects;
using Microsoft.Xna.Framework;
using ThinkDotNetEditorLib.Models.StaticObjects;
using ThinkDotNetEditorLib.States;

namespace ThinkDotNetEditorLib.Commands.Arena
{
    public class RemoveStaticObjectCmd : ICommand
    {
        private readonly StaticObject StaticObject;

        public RemoveStaticObjectCmd(StaticObject staticObject)
        {
            StaticObject = staticObject;
        }
        public void Execute()
        {
            Models.Arena arena = ServiceLocator.Instance.Resolve<Models.Arena>();
            arena.RemoveObject(StaticObject);
        }
        public void Rollback()
        {
            Models.Arena arena = ServiceLocator.Instance.Resolve<Models.Arena>();
            arena.AddObject(StaticObject);      
        }
    }
}
